﻿<navigation:Page x:Class="Candy.CreateProjectPage" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                 xmlns:gala="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL5"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="CreateProject" DataContext="{Binding Source={StaticResource Locator}, Path=CreateProject}">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <gala:EventToCommand Command="{Binding Init}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
        <Border HorizontalAlignment="Center" Height="300" VerticalAlignment="Center" Width="500" Background="{StaticResource ControlBackground}" BorderBrush="{StaticResource Accent}" BorderThickness="1" >
        
        <Grid x:Name="LayoutRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="117*"/>
                <ColumnDefinition Width="523*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Button Content="CANCEL" HorizontalAlignment="Right" Margin="0,6,8,8" Grid.Row="3" VerticalAlignment="Top" Width="75" Grid.Column="1" Command="{Binding Project.CancelEdit}" />
            <Button Content="CREATE" HorizontalAlignment="Left" Margin="236,6,0,8" Grid.Row="3" VerticalAlignment="Top" Width="75" Grid.Column="1" Command="{Binding Project.Save}" />
            <TextBlock HorizontalAlignment="Left" Margin="8,8,0,8" TextWrapping="Wrap" Text="create project" VerticalAlignment="Top" Grid.ColumnSpan="2" FontSize="{StaticResource HeaderFontSize}"/>
            <TextBlock HorizontalAlignment="Left" Margin="8,0,0,0" TextWrapping="Wrap" Text="Name" VerticalAlignment="Center"  Grid.Row="1"/>
            <TextBlock HorizontalAlignment="Left" Margin="8,4,0,0" TextWrapping="Wrap" Text="Description" VerticalAlignment="Top" Grid.Row="2"/>
            <TextBlock HorizontalAlignment="Left" Height="31" Margin="21,10,0,0" Grid.Row="2" TextWrapping="Wrap" VerticalAlignment="Top" Width="29"/>
            <TextBox Margin="8,4" Grid.Row="1" TextWrapping="Wrap" Text="{Binding Project.Entity.Name, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" VerticalAlignment="Center" Grid.Column="1"/>
            <TextBox Margin="8,8,8,4" Grid.Row="2" TextWrapping="Wrap" Text="{Binding Project.Entity.Description, Mode=TwoWay}" Grid.Column="1"/>

        </Grid>
    </Border>
</navigation:Page>
